Telegram Group & Telegram Channel
Все объекты, которые в настоящий момент существуют в памяти интерпретатора, можно получить с помощью gc.get_objects():


In [1]: class A:
...: def __init__(self, x):
...: self._x = x
...:
...: def __repr__(self):
...: class_name = type(self).__name__
...: x = self._x
...: return f'{class_name}({x!r})'
...:

In [2]: A(1)
Out[2]: A(1)

In [3]: A(2)
Out[3]: A(2)

In [4]: A(3)
Out[4]: A(3)

In [5]: [x for x in gc.get_objects() if isinstance(x, A)]
Out[5]: [A(1), A(2), A(3)]


👉@BookPython



tg-me.com/BookPython/3699
Create:
Last Update:

Все объекты, которые в настоящий момент существуют в памяти интерпретатора, можно получить с помощью gc.get_objects():


In [1]: class A:
...: def __init__(self, x):
...: self._x = x
...:
...: def __repr__(self):
...: class_name = type(self).__name__
...: x = self._x
...: return f'{class_name}({x!r})'
...:

In [2]: A(1)
Out[2]: A(1)

In [3]: A(2)
Out[3]: A(2)

In [4]: A(3)
Out[4]: A(3)

In [5]: [x for x in gc.get_objects() if isinstance(x, A)]
Out[5]: [A(1), A(2), A(3)]


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/BookPython/3699

View MORE
Open in Telegram


Библиотека Python разработчика Telegram | DID YOU KNOW?

Date: |

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Библиотека Python разработчика from de


Telegram Библиотека Python разработчика | Книги по питону
FROM USA